package 开始的剑指offer8月.搜索与回溯算法;
// https://leetcode-cn.com/problems/er-cha-shu-de-jing-xiang-lcof/
public class 剑指Offer27二叉树的镜像0819 {

      public class TreeNode {
          int val;
          TreeNode left;
          TreeNode right;
          TreeNode(int x) { val = x; }
      }

    class Solution {
        public TreeNode mirrorTree(TreeNode root) {
            if (root == null) {
                return null;
            }
            TreeNode left = mirrorTree(root.left);
            TreeNode right = mirrorTree(root.right);
            root.left = right;
            root.right = left;
            return root;
        }
    }
}
